using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using ShopForWeb.Model.Basic;
using ShopForWeb.Model.DBContexts;

namespace ShopForWeb.Services
{
    public class OrderDetailService
    {
        private ShopDBContext _db;
        public OrderDetailService(ShopDBContext db)
        {
            _db=db;
        }
        public async Task<List<OrderDetail>>GetByOrderIdAsync(string orderId)
        {
            var query=_db.OrderDetailSet
             .Where(od=>od.OrderId==orderId);
             return await query.ToListAsync();        
             }
    }
}